package br.edu.ifrn.potigol.lang.nodes;

import br.edu.ifrn.potigol.lang.Context;
import br.edu.ifrn.potigol.lang.PotigolException;
import br.edu.ifrn.potigol.lang.PotigolObject;

public class ArrayValueNode extends Node {
	private String name;
	private int index;
	
	public ArrayValueNode(String name, int index) {
		this.name = name;
		this.index = index;
	}

	@Override
	public PotigolObject eval(Context context) throws PotigolException {
		return context.getArrayValue(name, index);
	}
}
